import request from '@/utils/request'

// 查询当前用户出入库单据 列表
export function listStock(query) {
  return request({
    url: '/activiti/stock/list',
    method: 'get',
    params: query
  })
}

// 查询当前部门出入库单据 列表
export function listAllStock(query) {
  return request({
    url: '/activiti/stock/listAll',
    method: 'get',
    params: query
  })
}

// 查询出入库单据 详细
export function getStock(stockId) {
  return request({
    url: '/activiti/stock/' + stockId,
    method: 'get'
  })
}

// 新增出入库单据
export function addStock(data) {
  return request({
    url: '/activiti/stock',
    method: 'post',
    data: data
  })
}

// 撤回出入库单据
export function revoke(businessKey) {
  return request({
    url: '/activiti/stock/revoke',
    method: 'post',
    data: businessKey
  })
}

// 修改出入库单据
export function updateStock(data) {
  return request({
    url: '/activiti/stock',
    method: 'put',
    data: data
  })
}

// 删除出入库单据
export function delStock(stockId) {
  return request({
    url: '/activiti/stock/' + stockId,
    method: 'delete'
  })
}

// 导出出入库单据
export function exportStock(query) {
  return request({
    url: '/activiti/stock/export',
    method: 'get',
    params: query
  })
}
